import { permanentRedirect } from "next/navigation"; export const dynamic = "force-dynamic"; /** `/company/:id` is the legacy entity URL — permanently redirected to `/entity/:id` (tab preserved). */ export default async function CompanyPage({ params, searchParams }: { params: Promise<{ id: string }>; searchParams: Promise<{ tab?: string; range?: string; cursor?: string }> }) { const { id } = await params; const sp = await searchParams; const q = new URLSearchParams(); if (sp.tab) q.set("tab", sp.tab); if (sp.range) q.set("range", sp.range); if (sp.cursor) q.set("cursor", sp.cursor); const s = q.toString(); permanentRedirect(`/entity/${encodeURIComponent(id)}${s ? `?${s}` : ""}`); }